package com.example.demo.design.GoF.observer.observer;

import java.util.Observable;

/**
 * //具体目标类：原油期货
 *
 * @author luowj12
 * @since 2021/5/8 15:40
 */
public class OilFutures extends Observable {
    private float price;
    public float getPrice() {
        return this.price;
    }
    public void setPrice(float price) {
        super.setChanged();  //设置内部标志位，注明数据发生变化
        super.notifyObservers(price);    //通知观察者价格改变了
        this.price = price;
    }
}
